package main

import (
	"fmt"
	"time"
)

//利用协程进行遍历
func main() {
	intChan := make(chan int, 10)
	go readChan(intChan)
	for i := 1; i <= 100000; i++ {
		intChan <- i
		time.Sleep(time.Second)
	}
}

func readChan(intChan chan int) {
	for v := range intChan {
		fmt.Printf("%v \n", v)
	}
}
